<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var arr = [1,3,5,7,9,11];
    var arrCopy = arr.slice(1);
    var arrCopy2 = arr.slice(1,4);
    var arrCopy3 = arr.slice(1,-2);
    var arrCopy4 = arr.slice(-4,-1);
    // console.log(arr); 
    // console.log(arrCopy); 
    // console.log(arrCopy2);  
    // console.log(arrCopy3); 
    // console.log(arrCopy4); 
    // console.log(arr.splice(1, 0, 88, 77));
    // console.log(arr.indexOf(77));


    // var num = Number(prompt('输入'));
    // // var num = prompt('输入');
    // switch (num) {
    //   case 1:
    //     alert('haha');
    //     break;
    //   case 2:
    //     alert('hh');
    //     break;
    //   default:
    //     alert('all');
    //     break;
    // }


    // switch语句里面的num与case里面的，严格等于===。

    // 数组直接相加
    var arr1 = ['sda',[3, '打']];
    var arr2 = [1, 2];
    var arr3 = [{name: 'Tom',age: 30}, 33];
    console.log(arr1 + arr2); // sda,3,打1,2
    console.log(typeof (arr1 + arr2)); // string
  </script>
</body>
</html>